package com.yuno.mock.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/**
 * MinIO配置属性类
 *
 * @author xrm
 * @since 2025-11-06
 */
@Data
@Component
@ConfigurationProperties(prefix = "minio")
@Validated
public class MinioProperties {

    /**
     * MinIO服务端点URL
     */
    @NotBlank
    private String endpoint;

    /**
     * MinIO访问密钥
     */
    @NotBlank
    private String accessKey;

    /**
     * MinIO秘密密钥
     */
    @NotBlank
    private String secretKey;

    /**
     * 默认存储桶名称
     */
    @NotBlank
    private String bucketName;

    /**
     * 区域
     */
    @NotBlank
    private String region = "us-east-1";

    /**
     * 是否使用HTTPS
     */
    @NotNull
    private Boolean secure = false;

    /**
     * 连接超时时间(毫秒)
     */
    @NotNull
    private Integer connectTimeout = 10000;

    /**
     * 写入超时时间(毫秒)
     */
    @NotNull
    private Integer writeTimeout = 60000;

    /**
     * 读取超时时间(毫秒)
     */
    @NotNull
    private Integer readTimeout = 30000;
}